package santeclair.connexion.domaine.parametrage;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import santeclair.connexion.constantes.ConnexionConstantes;

/**
 * Protocole de la connexion
 */
@Entity
@Table(name = "tr_protocole", catalog = ConnexionConstantes.SCHEMA_NAME)
@Inheritance(strategy = InheritanceType.JOINED)
public class Protocole implements Serializable {

    public enum ProtocoleEnum {

        SOAP("SOAP"), MQSERIES("MQ Series"), LOCAL("Local"), FALLBACK("Fallback");

        private final String libelle;

        private ProtocoleEnum(String libelle) {
            this.libelle = libelle;
        }

        public String getLibelle() {
            return libelle;
        }
    }

    /**
     * Serial UID
     */
    private static final long serialVersionUID = 8916386950094595572L;

    /**
     * Identifiant du protocole.
     */
    @Id
    @Column(name = "IDPROTOCOLE")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer idProtocole;

    /**
     * Alias du protocole.
     */
    @Column(name = "ALIAS", nullable = true, length = 8)
    private String alias;

    /**
     * Libelle du protocole.
     */
    @Column(name = "LIBELLE", nullable = true, length = 64)
    private String libelle;

    public Integer getIdProtocole() {
        return idProtocole;
    }

    public void setIdProtocole(Integer idProtocole) {
        this.idProtocole = idProtocole;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

}
